<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="SolicitudesEditDlg" widgetVar="SolicitudesEditDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.EditSolicitudesTitle}">

            <h:form id="SolicitudesEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{solicitudesController.selected != null}">

                        <h:outputLabel value="#{bundle.EditSolicitudesLabel_idVisitas}" for="idVisitas" />
                        <h:outputText id="idVisitas" value="#{solicitudesController.selected.idVisitas}" />

                        <h:outputLabel value="#{bundle.EditSolicitudesLabel_motivo}" for="motivo" />
                        <p:inputText id="motivo" value="#{solicitudesController.selected.motivo}" title="#{bundle.EditSolicitudesTitle_motivo}" required="true" requiredMessage="#{bundle.EditSolicitudesRequiredMessage_motivo}"/>

                        <h:outputLabel value="#{bundle.EditSolicitudesLabel_fecha}" for="fecha" />
                        <p:calendar id="fecha" pattern="MM/dd/yyyy" value="#{solicitudesController.selected.fecha}" title="#{bundle.EditSolicitudesTitle_fecha}" required="true" requiredMessage="#{bundle.EditSolicitudesRequiredMessage_fecha}" showOn="button"/>

                        <h:outputLabel value="#{bundle.EditSolicitudesLabel_hora}" for="hora" />
                        <p:calendar id="hora" pattern="HH:mm:ss" value="#{solicitudesController.selected.hora}" title="#{bundle.EditSolicitudesTitle_hora}" required="true" requiredMessage="#{bundle.EditSolicitudesRequiredMessage_hora}" showOn="button"/>

                        <h:outputLabel value="#{bundle.EditSolicitudesLabel_idPracticas}" for="idPracticas" />
                        <p:selectOneMenu id="idPracticas" value="#{solicitudesController.selected.idPracticas}" required="true" requiredMessage="#{bundle.EditSolicitudesRequiredMessage_idPracticas}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{practicasController.items}"
                                           var="idPracticasItem"
                                           itemValue="#{idPracticasItem}"
                                           itemLabel="#{idPracticasItem.idPracticas.toString()}"
                                           />
                            <f:converter binding="#{practicasConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{solicitudesController.save}" value="#{bundle.Save}" update="display,:SolicitudesListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,SolicitudesEditDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="SolicitudesEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
